package com.crealth.model;

import java.io.Serializable;

import com.alibaba.fastjson.JSONObject;
import com.crealth.utils.Utils;

public class KnowledgeCreditLoanModel implements Serializable {
	private static final long serialVersionUID = 2802L;

	private int id;  //信用贷款 知识
	private String name;  //名称
	private String needCondition;  //具备条件
	private String needMaterial;  //提供资料
	private String loanAmount;  //贷款额度
	private String extendLoanCost;  //放款手续费
	private String interestRate;  //利息
	private String loanDeadline;  //贷款期限
	private String beforeRepayment;  //提前还款
	private String extendLoanTm;  //放款时间
	private String credit;  //信用
	private String liabilities;  //负债
	private String memo;  //备注
	private String shortInfo;  // 简要
	private String cityName;  // 哪个城市
	
	public KnowledgeCreditLoanModel() {
		id = 0;
		name = "";
		needCondition = "";
		needMaterial = "";
		loanAmount = "";
		extendLoanCost = "";
		interestRate = "";
		loanDeadline = "";
		beforeRepayment = "";
		extendLoanTm = "";
		credit = "";
		liabilities = "";
		memo = "";
		shortInfo = "";
		cityName = "";
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getNeedCondition() {
		return needCondition;
	}
	public void setNeedCondition(String needCondition) {
		this.needCondition = needCondition;
	}
	public String getNeedMaterial() {
		return needMaterial;
	}
	public void setNeedMaterial(String needMaterial) {
		this.needMaterial = needMaterial;
	}
	public String getLoanAmount() {
		return loanAmount;
	}
	public void setLoanAmount(String loanAmount) {
		this.loanAmount = loanAmount;
	}
	public String getExtendLoanCost() {
		return extendLoanCost;
	}
	public void setExtendLoanCost(String extendLoanCost) {
		this.extendLoanCost = extendLoanCost;
	}
	public String getInterestRate() {
		return interestRate;
	}
	public void setInterestRate(String interestRate) {
		this.interestRate = interestRate;
	}
	public String getLoanDeadline() {
		return loanDeadline;
	}
	public void setLoanDeadline(String loanDeadline) {
		this.loanDeadline = loanDeadline;
	}
	public String getBeforeRepayment() {
		return beforeRepayment;
	}
	public void setBeforeRepayment(String beforeRepayment) {
		this.beforeRepayment = beforeRepayment;
	}
	public String getExtendLoanTm() {
		return extendLoanTm;
	}
	public void setExtendLoanTm(String extendLoanTm) {
		this.extendLoanTm = extendLoanTm;
	}
	public String getCredit() {
		return credit;
	}
	public void setCredit(String credit) {
		this.credit = credit;
	}
	public String getLiabilities() {
		return liabilities;
	}
	public void setLiabilities(String liabilities) {
		this.liabilities = liabilities;
	}
	public String getMemo() {
		return memo;
	}
	public void setMemo(String memo) {
		this.memo = memo;
	}
	public String getShortInfo() {
		return shortInfo;
	}
	public void setShortInfo(String shortInfo) {
		this.shortInfo = shortInfo;
	}	
	public String getCityName() {
		return cityName;
	}
	public void setCityName(String cityName) {
		this.cityName = cityName;
	}

	public JSONObject toJSONObject() {		
		JSONObject resJson = new JSONObject();
		resJson.put("id", id);
		resJson.put("name", name);
		resJson.put("needCondition", needCondition);
		resJson.put("needMaterial", needMaterial);
		resJson.put("loanAmount", loanAmount);
		resJson.put("extendLoanCost", extendLoanCost);
		resJson.put("interestRate", interestRate);
		resJson.put("loanDeadline", loanDeadline);
		resJson.put("beforeRepayment", beforeRepayment);
		resJson.put("extendLoanTm", extendLoanTm);
		resJson.put("credit", credit);
		resJson.put("liabilities", liabilities);
		resJson.put("memo", memo);
		resJson.put("shortInfo", shortInfo);
		resJson.put("cityName", cityName);
		
		return resJson;
	}
	
	public void parseFromJson(JSONObject json) {
		id = Utils.getJsonIntValue(json, "id", 0);
		name = Utils.getJsonString(json, "name");
		needCondition = Utils.getJsonString(json, "needCondition");
		needMaterial = Utils.getJsonString(json, "needMaterial");
		loanAmount = Utils.getJsonString(json, "loanAmount");
		extendLoanCost = Utils.getJsonString(json, "extendLoanCost");
		interestRate = Utils.getJsonString(json, "interestRate");
		loanDeadline = Utils.getJsonString(json, "loanDeadline");
		beforeRepayment = Utils.getJsonString(json, "beforeRepayment");
		extendLoanTm = Utils.getJsonString(json, "extendLoanTm");
		credit = Utils.getJsonString(json, "credit");
		liabilities = Utils.getJsonString(json, "liabilities");
		memo = Utils.getJsonString(json, "memo");
		shortInfo = Utils.getJsonString(json, "shortInfo");
		cityName = Utils.getJsonString(json, "cityName");
	}
	
}
